<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <title>结构伪类选择器</title>
  <style>
    li:first-child {
        background-color: green;
    }

    li:nth-child(4){
        background-color: blue;
    }

    li:last-child {
        background-color: red;
    }
  </style>
</head>
<body>
<div>
  <ul>
    <li>1</li>
    <li>2</li>
    <li>3</li>
    <li>4</li>
    <li>5</li>
    <li>6</li>
  </ul>
</div>
</body>
</html>